using Clancy.Interfaces;
using System;

namespace Clancy.Data
{
    public class RecordingItem : IRecording
    {
        public RecordingItem()
        {
        }

        public RecordingItem(ISurveilanceObject survObj, string fullPath, DateTime timestamp, TimeSpan duration, byte[] jpegAsByteArray)
        {
            Id = Guid.NewGuid();
            SurveilanceGuid = survObj.Id;
            FilePath = fullPath;
            Timestamp = timestamp;
            Duration = duration;
            SurveilanceName = survObj.Name;

            PreviewThumnbailAsJepg = jpegAsByteArray;
        }

        public TimeSpan Duration { get; set; }

        public string FilePath { get; set; }

        public Guid Id { get; set; }

        public byte[] PreviewThumnbailAsJepg { get; private set; }

        public Guid SurveilanceGuid { get; set; }

        public string SurveilanceName { get; private set; }

        public DateTime Timestamp { get; set; }

        public override string ToString()
        {
            return string.Format("{0} ({1})", Timestamp, Duration);
        }
    }
}